package client;

public abstract class Measurement implements Comparable<Measurement> {
	protected int clientID;
	protected long start_time;
	protected long stop_time;
	
	public long getMilliseconds() {
		return stop_time - start_time;
	}
	
	public long getStop() {
		return stop_time;
	}
	
	public long getStart() {
		return start_time;
	}
	
	public Measurement(int _clientID, long _start_time, long _stop_time) {
		clientID = _clientID;
		start_time = _start_time;
		stop_time = _stop_time;
	}
	
	public int compareTo(Measurement r) {
		long diff = this.stop_time - r.stop_time;
		return diff < 0 ? -1 : (diff == 0 ? 0 : 1);
	}
}
